package sanyueer;

import object.Point;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class GenericDemo {
    public static void main(String[] args) {
        Collection<String>c=new ArrayList<>();
        c.add("66");
        c.add("88");
        c.add("99");
        Iterator<String> it=c.iterator();
        while (it.hasNext()){
            String str= it.next();
            System.out.println(str);
        }
        for (String str:c){
            System.out.println(str);
        }
    }
    /*
    Collection<Point>c=new ArrayList<>();
        c.add(new Point(6,7));
        c.add(new Point(7,8));
        c.add(new Point(8,9));

    Iterator<Point>it= c.iterator();
        while (it.hasNext()){
        Point p= it.next();
        System.out.println(p);
    }
        for (Point p:c){
        System.out.println(p);
    }

     */
}
